﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Helper
{
    public class PopulateDropDown
    {

        static public void EnumToListBox(Type EnumType, ListControl TheListBox)
        {

            Array Values = System.Enum.GetValues(EnumType);



            foreach (int Value in Values)
            {

                string Display = Enum.GetName(EnumType, Value);

                ListItem Item = new ListItem(Display, Value.ToString());

                TheListBox.Items.Add(Item);

            }

        }

    }

}


